<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>输入月份显示每年天数</title>
		<style>
			span{
				color: darkviolet;
				font-family: verdana;
				font-size: 26px;
			}
		</style>
	</head>
	<body>
		<script>
			var year=prompt("请输入年份：");
			
			
			    document.write("一月：<span>31</span>天<br/>");
			
			if(year%4==0&&year%100!=0||year%400==0){
				
				document.write("二月：<span>29</span>天<br/>");
				
			}else{
				document.write("二月：<span>28</span>天<br/>");
			}  
			    
			    document.write("三月：<span>31</span>天<br/>");
				document.write("四月：<span>30</span>天<br/>");
				document.write("五月：<span>31</span>天<br/>");
				document.write("六月：<span>30</span>天<br/>");
				document.write("七月：<span>31</span>天<br/>");
				document.write("八月：<span>31</span>天<br/>");
				document.write("九月：<span>30</span>天<br/>");
				document.write("十月：<span>31</span>天<br/>");
				document.write("十一月：<span>30</span>天<br/>");
				document.write("十二月：<span>31</span>天<br/>");
		</script>
	</body>
</html>
